<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:converge="http://com.interactivemediamanagement.converge/tags">
    <ui:composition template="/WEB-INF/facelets/templates/default.xhtml">

        <ui:define name="title">
            <h:outputText value="#{msgs.INBOX}" />
        </ui:define>

        <ui:define name="pageBody">
            <div id="layout2">
                <div id="leftColumn">
                    <ui:insert name="leftTop" />
                    <h:form id="frmMyItems">
                        <converge:moduleHeader moduleTitle="#{converge:abbreviate(userSession.user.fullName, 25)}" />
                        <div class="moduleContent">
                            <h:panelGrid columns="2">
                                <c:if test="#{inbox.privilegedToCreateNewAssignments}">
                                    <h:graphicImage value="#{res.BULLET_ICON}" alt="#{msgs.inbox_NEW_ASSIGNMENT}" title="#{msgs.inbox_NEW_ASSIGNMENT}" />
                                    <a4j:commandLink reRender="frmNewAssignment" actionListener="#{inbox.onNewAssignment}" oncomplete="#{rich:component('mpNewAssignment')}.show();#{rich:element('frmNewAssignment:txtNewsItemTitle')}.focus()">
                                        <h:outputText value="#{msgs.inbox_NEW_ASSIGNMENT}" />
                                    </a4j:commandLink>
                                </c:if>

                                <h:graphicImage value="#{res.BULLET_ICON}" alt="#{msgs.inbox_MY_ASSIGNMENTS}" title="#{msgs.inbox_MY_ASSIGNMENTS}" />
                                <a4j:commandLink reRender="frmInbox" actionListener="#{inbox.onShowMyAssignments}">
                                    <h:outputText value="#{msgs.inbox_MY_ASSIGNMENTS}" />
                                </a4j:commandLink>

                                <h:graphicImage value="#{res.BULLET_ICON}" alt="#{msgs.inbox_EMPTY_TRASH}" title="#{msgs.inbox_EMPTY_TRASH}" />
                                <a4j:commandLink reRender="frmInbox" actionListener="#{inbox.onEmptyTrash}" ajaxSingle="true">
                                    <h:outputText value="#{msgs.inbox_EMPTY_TRASH}" />
                                </a4j:commandLink>
                            </h:panelGrid>
                        </div>

                        <converge:moduleSpacer />

                        <converge:moduleHeader moduleTitle="#{msgs.OUTLETS}" />
                        <div class="moduleContent">

                            <rich:tree reRender="frmInbox" ajaxSubmitSelection="true"  switchType="client" value="#{inbox.outletsNode}" var="item" nodeFace="#{item.type}" nodeSelectListener="#{inbox.onOutletFolderSelect}">

                                <rich:treeNode type="dk.i2m.converge.core.workflow.Outlet" iconLeaf="#{res.INBOX_OUTLET_ICON}" icon="#{res.INBOX_OUTLET_ICON}" >
                                    <h:outputText value="#{item.data.title}" />
                                </rich:treeNode>

                                <rich:treeNode type="dk.i2m.converge.core.workflow.WorkflowState" iconLeaf="#{res.INBOX_WORKFLOW_STATE_ICON}" icon="#{res.INBOX_WORKFLOW_STATE_ICON}">
                                    <h:outputText value="#{item.data.name}" />
                                </rich:treeNode>

                                <rich:treeNode type="dk.i2m.converge.core.content.MediaRepository" iconLeaf="#{res.INBOX_MEDIA_REPOSITORY_ICON}" icon="#{res.INBOX_MEDIA_REPOSITORY_ICON}" >
                                    <h:outputText value="#{item.data.name}" />
                                </rich:treeNode>

                                <rich:treeNode type="dk.i2m.converge.core.content.MediaItemStatus" iconLeaf="#{res.INBOX_MEDIA_REPOSITORY_ICON}" icon="#{res.INBOX_MEDIA_REPOSITORY_ICON}" >
                                    <h:outputText value="#{item.data}" />
                                </rich:treeNode>

                            </rich:tree>
                        </div>
                    </h:form>
                    <converge:moduleSpacer />

                    <ui:insert name="leftBottom" />
                </div>
                <div id="rightColumn">
                    <ui:insert name="body" />
                </div>
            </div>
        </ui:define>
    </ui:composition>
</html>